import React from "react";
import { message, Collapse } from "antd";
import {
    EnvironmentOutlined,
    RightOutlined,
} from "@ant-design/icons";
import styles from "./address.module.less"
const { Panel } = Collapse;
const AddressList = ({ style = {}, list = [], setMapCenter = Function }) => {

    return (
        <>
            <div className={styles.box} style={style}>
                <Collapse accordion className={styles.address_box} expandIconPosition='end'>
                    <Panel header="风险地址列表" key="1">
                        <ul className="list">
                            {list.map((item) => {
                                return (
                                    <li key={item.latitude} onClick={() => setMapCenter(item)}>
                                        <EnvironmentOutlined />
                                        <span className={styles.areaName}>{item.policyHolder || item.areaName || item.address}</span>
                                        <RightOutlined />
                                    </li>
                                );
                            })}
                        </ul>
                    </Panel>
                </Collapse>
            </div>

        </>
    )
}
export default AddressList;